#include <stdio.h>
#include <string.h>

int main()
{
    FILE* fp=fopen("log.txt","w");
    if(fp==NULL)
    {
        perror("fopen");
        return 1;
    }
    const char* ch="hello linux";
    int count=10;
    while(count--)
    {
        fprintf(fp,"%s--->%d\n",ch,count);
    }
    fclose(fp);
    return 0;
}
